package com.didd.core.security;

import com.didd.core.common.base.ResultStatus;
import lombok.AllArgsConstructor;
import lombok.ToString;

/**
 * 登录异常
 * @author diddd
 * @since 2020-07-20
 */
@ToString
@AllArgsConstructor
public enum LoginResultCode implements ResultStatus {

    /**
     * 用户名密码错误
     */
    LOGIN_NAME_PASSWORD_ERROR(10000, "LOGIN_NAME_PASSWORD_ERROR", "用户名或密码错误"),
    /**
     * 账号禁用
     */
    ACCOUNT_IS_DISABLE(10001, "ACCOUNT_IS_DISABLE", "账号已禁用，请联系系统管理员"),

    /**
     * 登录失效
     */
    TOKEN_IS_ERROR(10002, "TOKEN_IS_ERROR", "登录失效"),
    ;

    /**
     * return code
     */
    private int code;
    /**
     * return status
     */
    private String status;
    /**
     * return warning
     */
    private String message;

    @Override
    public int fetchCode() {
        return code;
    }

    @Override
    public String fetchStatus() {
        return status;
    }

    @Override
    public String fetchMessage() {
        return message;
    }
}
